linux: Fix backward compatibility in page table handling
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 26 Feb 2007 14:09:08 +0000 (14:09 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 26 Feb 2007 14:09:08 +0000 (14:09 +0000)
A 3.0.2 compatibility requirement slipped my attention before
submitting the original page table handling changes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h

index 7edb3e7ccfe25c9695b4761719b3f0e585ed883a..31ce73e2665945e5302818e4d069c52a269d296c 100644 (file)
@@ -139,7 +139,11 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 static inline unsigned long pgd_val(pgd_t x)
 {
        unsigned long ret = x.pgd;
+#ifdef CONFIG_XEN_COMPAT_030002
+       if (ret) ret = machine_to_phys(ret) | _PAGE_PRESENT;
+#else
        if (ret & _PAGE_PRESENT) ret = machine_to_phys(ret);
+#endif
        return ret;
 }
 #define HPAGE_SHIFT    22